<template>
  <u-navbar
    :centerTitle="centerTitle"
    :is-back="isBack"
    :is-fixed="false"
    :background="{ background: 'transparent' }"
  >
    <view class="slot-wrap" >
      <view class="text" >
        <u-text :bold="true" color="#000" :text="title" size="40"></u-text>
      </view>
      <u-button 
        v-if="mode !== 'search'"
        shape="circle"
        size="medium"
        :plain="true"
        @click="search"
      >
        <u-icon name="search" size="28"></u-icon>
        搜索
      </u-button>
    </view>
  </u-navbar>
</template>

<script setup>
defineProps({
    centerTitle: {
        type: String||null,
        default: null,
    },
    title: {
      type: String,
      default: '推荐',
    },
    isBack: {
      type: Boolean,
      default: false,
  },
  mode: {
    type: String,
    default: null,
  }
  });
  const search = () => {
 uni.navigateTo({
    url: '/pages/search/index',
  })
  };
</script>

<style scoped lang="scss">
  .slot-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40rpx;
  }
</style>
